﻿using UnityEngine;
using System.Collections;

public class Plunger : MonoBehaviour {
	[HideInInspector]
	public Rigidbody2D hull;
	[HideInInspector]
	public Vector2 pullForce = new Vector2(0,-10000000);
	[HideInInspector]
	public Vector2 pushForce = new Vector2(0,10000000);
	// Use this for initialization
	void Start ()
	{
		hull = GetComponent<Rigidbody2D> ();
	}
	
	// Update is called once per frame
	void Update ()
	{
		if (Input.GetButton ("Jump")) 
			hull.AddForce(pullForce);
		else
			hull.AddForce(pushForce);

		hull.velocity = new Vector2 (0, hull.velocity.y);
	}
}
